import { createStore, applyMiddleware } from 'redux'
import reducer from './reducers'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunk from 'redux-thunk'
/* saga */
// import createSagaMiddleware from '@redux-saga/core'
// import rootSaga from './sagas'

export type RootState = {
  bussiness: { subjects: any[], actionType: 'bulkFishing' | 'singleFishing' | 'bulkAssign' },
  user: { userInfo: any, routes: any[] }
}
/* 生成saga */
// const sagaMiddleware = createSagaMiddleware()

const store = createStore(
  reducer,
  //@ts-ignore
  composeWithDevTools(applyMiddleware(thunk))
)
/* 启用saga */
// sagaMiddleware.run()
export default store